<?php

/**
 * This is the model class for table "bln_app_onlinequeue_service_queueline_transaction_queue".
 *
 * The followings are the available columns in table 'bln_app_onlinequeue_service_queueline_transaction_queue':
 * @property integer $_id
 * @property integer $transaction_id
 * @property integer $queue_number
 * @property integer $queue_member_id
 * @property integer $queue_admin_id
 * @property string $makequeue_status
 * @property string $processqueue_status
 * @property string $queue_status
 * @property string $data
 */
class BMServiceQueueLineTransactionQueue extends BAppDbActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return BMServiceQueueLineTransactionQueue the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'bln_app_onlinequeue_service_queueline_transaction_queue';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('transaction_id', 'required'),
			array('transaction_id, queue_number, queue_member_id, queue_admin_id', 'numerical', 'integerOnly'=>true),
			array('makequeue_status, processqueue_status, queue_status', 'length', 'max'=>10),
			array('data', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('_id, transaction_id, queue_number, queue_member_id, queue_admin_id, makequeue_status, processqueue_status, queue_status, data', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'_id' => 'ID',
			'transaction_id' => 'Transaction',
			'queue_number' => 'Queue Number',
			'queue_member_id' => 'Queue Member',
			'queue_admin_id' => 'Queue Admin',
			'makequeue_status' => 'Makequeue Status',
			'processqueue_status' => 'Processqueue Status',
			'queue_status' => 'Queue Status',
			'data' => 'Data',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('_id',$this->_id);
		$criteria->compare('transaction_id',$this->transaction_id);
		$criteria->compare('queue_number',$this->queue_number);
		$criteria->compare('queue_member_id',$this->queue_member_id);
		$criteria->compare('queue_admin_id',$this->queue_admin_id);
		$criteria->compare('makequeue_status',$this->makequeue_status,true);
		$criteria->compare('processqueue_status',$this->processqueue_status,true);
		$criteria->compare('queue_status',$this->queue_status,true);
		$criteria->compare('data',$this->data,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}